#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "a.h"


int a_setName(struct A * a , char * _name);
void a_free(struct A ** a);

void a_init(struct A ** a)
{
	struct A * b = NULL;
	b = (struct A *)malloc(sizeof(struct A));
	b -> name = NULL;
	b -> setName = &a_setName;
	b -> free = &a_free;
	*a = b;
	printf("b = %p\n",b);
}

int a_setName(struct A * a , char * _name)
{
	a -> name = _name;
	return 0;
}


void a_free(struct A ** a)
{
	if(*a != NULL)
	{
		free(*a);
	}
	*a = NULL;
}

